package com.itheima;

public class Test5{
    public static void main(String[] args) {
        double num = 3.14;
        int abs = round(num);
        System.out.println(num +"四舍五入之后是" + abs);
    }
    public static int round(double num){
        int a = (int)(num * 10) % 10;
        if(a < 5){
            return (int)num;
        }else{
            return (int)num + 1;
        }
    }
}